/***************************************************
 ** @Desc : This file for 注册网站信息
 ** @Time : 2019.01.09 17:28 
 ** @Author : Joker
 ** @File : site_info
 ** @Last Modified by : Joker
 ** @Last Modified time: 2019.01.09 17:28
 ** @Software: GoLand
****************************************************/
package models

import (
	"github.com/astaxie/beego/orm"
	"your_regist/utils"
)

var log = utils.Log{}

type SiteInfo struct {
	Id      int
	CnName  string
	EnName  string
	ReqAddr string
	Cookie  string
	HomeUrl string
}

func (*SiteInfo) TableEngine() string {
	return "INNODB"
}

func (*SiteInfo) TableName() string {
	return SiteInfoTBName()
}

func (*SiteInfo) SelectAllRegisterInfo() (sites []SiteInfo) {
	om := orm.NewOrm()
	_, err := om.QueryTable(SiteInfoTBName()).Limit(-1).All(&sites)
	if err != nil {
		log.LogError("SelectAllRegisterInfo failed to select all:", err)
	}
	return sites
}
